/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.rtx.utils;

import com.alee.extended.label.WebLinkLabel;
import com.alee.laf.WebLookAndFeel;
import com.alee.laf.rootpane.WebFrame;
import im.rtx.base.service.ThemeService;
import im.rtx.core.context.AppContext;
import im.rtx.ui.component.pannel.TitlePanel;
import im.rtx.ui.component.theme.ThemeResources;
import im.rtx.ui.frame.LoginFrame;
import im.rtx.ui.frame.MainFrame;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.awt.*;

/**
 * Project  : im.rtx.utils
 * Author   : solosky < solosky772@qq.com >
 * Created  : 2014/10/18
 * License  : Apache License 2.0
 */
public class Launcher {

    public static void main(String[] args){
        WebLookAndFeel.setDecorateAllWindows(false);
        WebLookAndFeel.install();

        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring-config.xml");
        ThemeService themeService = AppContext.getBean(ThemeService.class);

 //       LoginFrame loginFrame = AppContext.getBean(LoginFrame.class);
 //       loginFrame.setVisible(true);
//        WebFrame frame = new WebFrame();
//        frame.setUndecorated(true);
//        TitlePanel titlePanel = new TitlePanel(frame);
//        frame.add(titlePanel, BorderLayout.NORTH);
//        frame.setRound(0);
//        frame.setShowTitleComponent(false);
//        frame.setShowWindowButtons(false);
//        frame.add(new WebLinkLabel("http://www.baidu.com"), BorderLayout.CENTER);
//        frame.setSize(200,100);
//        frame.pack();
//        frame.setVisible(true);

        MainFrame mainFrame = AppContext.getBean(MainFrame.class);
        mainFrame.setVisible(true);
    }
}
